/*
 * Created: Author: Aléx Carvalho / Date: Feb 9, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-06-11 04:28:43 +0000 (Thu, 11 Jun 2015) $
 */
package com.cpm.wrapper;

import com.cpm.aggregate.Attribute;
import javax.persistence.Embeddable;

@Embeddable
public class Performance implements Attribute<Float> {
    
    private Float performance;

    public static final Performance INVALID = new Performance(Float.NaN);
            
    public Performance() {
    }

    public Performance(Float performace) {
        this.performance = performace;
    }

    @Override
    public Float getValue() {
        return performance;
    }
    
    public Performance plus(Performance value) {
        return plus(value.getValue());
    }
    
    public Performance plus(Float value) {
        return new Performance(performance + value);
    }

    @Override
    public String toString() {
        return String.valueOf(performance);
    }
}
